<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改产品供应商')" />

    <th:block th:include="include :: jquery-cxselect-js" />


</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-supplier-edit" th:object="${supplier}">
            <input id="supplierId" name="supplierId" th:field="*{supplierId}"  type="hidden">

            <div class="form-group">
                <label class="col-sm-2 control-label is-required">供应商名称：</label>
                <div class="col-sm-10">
                    <input id="supplierName" name="supplierName" th:field="*{supplierName}" class="form-control" type="text" required>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label is-required">供应商编码：</label>
                <div class="col-sm-10">
                    <input id="supplierCode" name="supplierCode" th:field="*{supplierCode}" class="form-control" type="text" required>
                </div>
            </div>

            <!-- 关联分类-->
            <div class="form-group">
                <label class="col-sm-2 control-label">供应商分类：</label>
                <div class="col-sm-10">
                    <select name="supplierCategoryId" class="form-control m-b" >
                        <option value=0>全部</option>
                        <option th:each="category : ${categorys}" th:text="${category.supplierCategoryName}"
                                th:value="${category.supplierCategoryId}" th:field="*{supplierCategoryId}"></option>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label is-required">联系人：</label>
                <div class="col-sm-10">
                    <input id="supplierContact" name="supplierContact" th:field="*{supplierContact}" class="form-control" type="text" required>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label is-required">联系电话：</label>
                <div class="col-sm-10">
                    <input id="supplierMobile" name="supplierMobile" th:field="*{supplierMobile}" class="form-control" type="text" required>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label is-required">座机号码：</label>
                <div class="col-sm-10">
                    <input id="supplierLandline" name="supplierLandline" th:field="*{supplierLandline}" class="form-control" type="text" required>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label is-required">邮箱：</label>
                <div class="col-sm-10">
                    <input id="supplierEmail" name="supplierEmail" th:field="*{supplierEmail}" class="form-control" type="text" required>
                </div>
            </div>

            <!-- 	省市区联动 TODO-->
            <div  class="form-group" id="element_id" data-url="cityData.min.json" data-selects="province,city,area"
                  data-required="true"></div>


            <div class="form-group">
                <label class="col-sm-2 control-label is-required">详细地址：</label>
                <div class="col-sm-10">
                    <input id="supplierAddress" name="supplierAddress" th:field="*{supplierAddress}" class="form-control" type="text" required>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label is-required">银行账号：</label>
                <div class="col-sm-10">
                    <input id="supplierBankAccount" name="supplierBankAccount" th:field="*{supplierBankAccount}" class="form-control" type="text"
                           required>
                </div>
            </div>


            <div class="form-group">
                <label class="col-sm-2 control-label is-required">开户银行：</label>
                <div class="col-sm-10">
                    <input id="supplierBank" name="supplierBank" th:field="*{supplierBank}" class="form-control" type="text" required>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label is-required">持卡人姓名：</label>
                <div class="col-sm-10">
                    <input id="supplierCardholderName" name="supplierCardholderName" th:field="*{supplierCardholderName}" class="form-control"
                           type="text" required>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label is-required">税务登记号：</label>
                <div class="col-sm-10">
                    <input id="supplierTaxId" name="supplierTaxId" th:field="*{supplierTaxId}" class="form-control" type="text" required>
                </div>
            </div>


            <div class="form-group">
                <label class="col-sm-2 control-label is-required">显示排序：</label>
                <div class="col-sm-10">
                    <input class="form-control" type="text" name="orderNum" th:field="*{orderNum}"  required>
                </div>
            </div>

		</form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "goods/supplier";

		$("#form-unit-edit").validate({
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	        	// var sHTML = $('.summernote').summernote('code');
				// $("#unitContent").val(sHTML);
				$.operate.save(prefix + "/edit", $('#form-supplier-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
